<!DOCTYPE html>
<html lang="en">
<head>
    <title>教师信息管理系统</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../css/bootstrap-responsive.min.css" />
    <link rel="stylesheet" href="../css/colorpicker.css" />
    <link rel="stylesheet" href="../css/datepicker.css" />
    <link rel="stylesheet" href="../css/uniform.css" />
    <link rel="stylesheet" href="../css/select2.css" />
    <link rel="stylesheet" href="../css/matrix-style2.css" />
    <link rel="stylesheet" href="../css/matrix-media.css" />
    <link rel="stylesheet" href="../css/bootstrap-wysihtml5.css" />
    <link href="../font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
</head>
<body>

<div id="content">
    <div id="content-header">
        <h1>教学情况</h1>
    </div>
    <div class="container-fluid">
        <div class="row-fluid">
            <div id="form_3" class="span12">
                <button id="adde" class="btn btn-info btn-large" style="border-radius: 5px">添加指导学生发表论文</button>
                <form action="/paper/leadOut" method="post" style="display: inline-block;">
                    <input id="cuId2" name="cuId" type="text" style="display: none" >
                    <input type="submit" class="btn btn-info btn-large" style="border-radius: 5px"; value="保存为Excel";>
                </form>
                <div class="widget-box">
                    <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
                        <h5>指导学生发表论文</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <span id="span1" style="color: red;" className="paper"></span>
                        <table class="table table-bordered table-striped" frame="box">
                            <thead>
                            <tr><th colspan="11" >已添指导论文内容(删除重新添加以修改)</th></tr>
                            <tr>
                                <th>编号</th>
                                <th>论文名称</th>
                                <th>期刊</th>
                                <th>日期</th>
                                <th>级别</th>
                                <th>学生姓名</th>
                                <th>第一作者</th>
                                <th>学生名次</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody id="tbody">

                            </tbody>
                        </table>
                        <div id="form3" class="span12" style="display: none">
                            <form id="form1" action="#" method="get" class="form-horizontal">
                                <input id="cuId" name="cuId" type="text" style="display: none">
                                <div class="control-group">
                                    <label class="control-label">论文名称：</label>
                                    <div class="controls">
                                        <input name="paperTitle" type="text" class="span11"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">期刊：</label>
                                    <div class="controls">
                                        <input name="periodical" type="text" class="span11"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">日期 ：</label>
                                    <div class="controls">
                                        <input name="publishTime" type="date" class="span11"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">级别：</label>
                                    <div class="controls">
                                        <input name="rank" type="text" class="span11"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">学生姓名：</label>
                                    <div class="controls">
                                        <input name="stuName" type="text" class="span11"  />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">第一作者 ：</label>
                                    <div class="controls">
                                        <input name="firstAuthor" type="text" class="span11" />
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">学生名次：</label>
                                    <div class="controls">
                                        <input name="stuRank" type="text"  class="span11" />

                                    </div>
                                </div>

                            </form>
                            <center>
                                <div class="control-group">
                                    <div class="controls">
                                        Excel：<input id="excel"  type="file" size="15" style="opacity: 0;"><br>
                                        <button id="leadIn" class="btn btn-primary btn-large" style="margin-bottom: 20px;border-radius: 5px">导入Excel</button>
                                        <button id="btn1" class="btn btn-success btn-large" style="margin-bottom: 20px;border-radius: 5px">保存基本信息</button>
                                    </div>
                                </div>

                            </center>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="http://www.jq22.com/jquery/jquery-1.7.1.js"></script>
<script src="../js/jquery.ui.custom.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-colorpicker.js"></script>
<script src="../js/bootstrap-datepicker.js"></script>

<script src="../js/masked.js"></script>
<script src="../js/jquery.uniform.js"></script>
<script src="../js/select2.min.js"></script>
<script src="../js/matrix.js"></script>
<script src="../js/matrix.form_common.js"></script>
<script src="../js/wysihtml5-0.3.0.js"></script>
<script src="../js/jquery.peity.min.js"></script>
<script src="../js/bootstrap-wysihtml5.js"></script>
<script type="text/javascript" src="../js/jquery.cookie.js"></script>
<script src="../js/tool.js"></script>
<script>
    $(function () {
        var CLASS_NAME=$("#span1").attr("className");
        queryPage(1);
        //保存
        $("#btn1").click(function () {
            var r = confirm("* 需提供立项文件、过程文件、结项文件	\n"+
                "\t\t您是否确定保存？")
            if (r == true) {
                add(CLASS_NAME);
            }
        })
    })
    //表格填充
    function queryPage(pageNum){
        //当前页码
        pageNum= pageNum==undefined?1:pageNum;

        //页码的有效性判断
        $.get("../paper",{page:pageNum,limit:50,cuId:$.cookie("cuId")},function(result){
            console.log(result.data)
            //填充数据到tbody
            $("#tbody").empty();//清除之前的内容
            $(result.data).each(function(index,paper){
                console.log(paper.certificate)
                $("#tbody").append(
                    " <tr>"+
                    "<td>"+(index+1)+"</td>"+
                    "<td>"+paper.paperTitle+"</td>"+
                    "<td >"+paper.periodical+"</td>"+
                    "<td >"+paper.publishTime+"</td>"+
                    "<td>"+paper.rank+"</td>"+
                    "<td>"+paper.stuName+"</td>"+
                    "<td>"+paper.firstAuthor+"</td>"+
                    "<td>"+paper.stuRank+"</td>"+
                    "<td>"+
                    "<a href='#' id='remove' class='icon-trash' eid="+paper.id+" >删除</a></td>"+
                    "</tr>"
                );
            })

        },"json");
    }

</script>
</body>
</html>
